﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using static HW.Database.EntityBase;

namespace HW.Core.Extension
{
    public static class AttributeExtension
    {
        //获取自定义属性别名
        public static string GetAlias(this PropertyInfo property)
        {
            var aliasAttribute = (MyAttribute)property.GetCustomAttribute(typeof(MyAttribute));
            return aliasAttribute != null ? aliasAttribute.Alias : property.Name;
        }
    }
}
